import {dobounce} from "./ytils";

import BackTop from "../components/content/backTop/BackTop";

export const itemLoading = {
  data(){
    return{
      itemLoad: null,
      newRefresh: null
    }
  },
  mounted(){
     this.newRefresh = dobounce(this.$refs.scroll.refreshScroll,100)
    this.itemLoad = ()=>{this.newRefresh()}

    this.$bus.$on('imageItemLoad',this.itemLoad)
  }
}

export const scrollTopMixin = {
  data() {
    return {
      isShowBackTop: false,
    }
  },
  components: {
    BackTop
  },
  methods: {
    backTop(){
      //返回顶部
      this.$refs.scroll.scroll.scrollTo(0,0,1000);
    }
  }
}